package cn.edu.lingnan.service;

import cn.edu.lingnan.dao.CountryMapper;
import cn.edu.lingnan.pojo.Country;

import java.sql.SQLException;
import java.util.List;

public class CountryServiceMysqlImpl implements CountryService{
    private CountryMapper countryMapper;

    public void setCountryMapper(CountryMapper countryMapper) {
        this.countryMapper = countryMapper;
    }

    @Override
    public Country findCountryByCountry_id(int country_id) {
        return countryMapper.findCountryByCountry_id(country_id);
    }

    @Override
    public Country findCountryByCountry_idIfInC_V(int country_id) {
        return countryMapper.findCountryByCountry_idIfInC_V(country_id);

    }

    @Override
    public boolean findCountryByNameAndPeople(String country_name, String _people) {
        return false;
    }

    //登陆国家名字和密码
    @Override
    public Country findCountryByNameAndPassword(String country_name, String password) {
        return countryMapper.findCountryByNameAndPassword(country_name, password);
    }

    @Override
    public List<Country> findAllCountry() {
        return countryMapper.findAllCountry();
    }

    @Override
    public List<Country> findAllCountry_isdelete() {
        return null;
    }

    @Override
    public int insertInfoToCountry(Country country) {
        return countryMapper.insertInfoToCountry(country);
    }

    @Override
    public int updataCountryCountry_name(Country _sd) {
        return 0;
    }

    @Override
    public int updataCountryPeople(Country _sd) {
        return 0;
    }

    @Override
    public int updataCountryVac_able(Country _sd) {
        return 0;
    }

    @Override
    public int updataInfotoCountry(Country _sd) {
        return countryMapper.updataInfotoCountry(_sd);
    }

    @Override
    public boolean deleteCountry(int country_id) throws SQLException {
        return countryMapper.deleteCountry(country_id);
    }
}
